#ifndef _RING_BUFFER_H_
#define _RING_BUFFER_H_

#include <stdint.h>

typedef struct _ring_buffer_t RING_BUFFER_t;

struct _ring_buffer_t
{
	void *body;
	int (*read)(RING_BUFFER_t*, uint8_t*, int);
    int (*restore)(RING_BUFFER_t*, uint8_t*, int);
	int (*write)(RING_BUFFER_t*, uint8_t*, int);
	int (*write_byte)(RING_BUFFER_t*, uint8_t);
	void (*clear)(RING_BUFFER_t*);
	void (*destory)(RING_BUFFER_t**);
};

extern RING_BUFFER_t* create_ring_buffer(int size);

#endif